<template>
  <div>
    <div class="shopName">
      <h1 class="name">{{ shopName }}</h1>
      <div class="evaluation">
        <h2>店铺评价</h2>
        <el-rate
            class="rate"
            v-model="rate"
            disabled
            show-score
            text-color="#ff9900"
            score-template="{value}">
        </el-rate>
      </div>
    </div>
    <ProductList :select="'3'" :search="shopName"></ProductList>
  </div>
</template>

<script>
import ProductList from '@/components/commons/productList'
export default {
  name: "shopDetail",
  components: {ProductList},
  data() {
    return {
      shopId: '',
      rate: 0,
      shopName: this.$route.params.shopName
    }
  },
  methods: {
    getShopDetail(shopId){
      this.$axios.get(`/getShopDetail/${shopId}`)
          .then(res => {
            this.shopName = res.data.data.shopName
            this.rate = res.data.data.rate
          })
    }
  },
  mounted() {
  },
  created() {
    this.getShopDetail(this.$route.params.shopId)
  }
}
</script>

<style scoped>
.shopName{
  background-color: #E4E7ED;
  width: 100%;
  height: 100px;
  text-align: center;
  margin-top: 5px;
  border: 1px solid #c1c6d0;
}
.name{
  float: left;
  width: 75%;
  margin: 0 auto;
  line-height: 100px;
  border-right: 1px solid #c1c6d0;
}
.evaluation{
  width: 20%;
  float: left;
  margin: 0 20px 0 20px;
}
</style>